<!DOCTYPE html>
<html class="html">
	<head>
		<title>New</title>
		<link rel="stylesheet" href="css/structure.css" type="text/css" />
		<link rel="stylesheet" href="css/form.css" type="text/css" />
		<link rel="stylesheet" href="css/theme.css" type="text/css" />
		<script type="text/javascript">
			function set()
			{
				//Get the passed parameters
				var Args = location.search.substring(1);
				var id = Args.split('=')[1]; 
				//Show data according to passed parameters
				var title=document.getElementById("pageTitle");
				if(id==0)
					title.innerHTML="New Announcement";
				if(id==1)
					title.innerHTML="New Article";
				if(id==2)
					title.innerHTML="New Complaint";
				if(id==4)
				{
					title.innerHTML="Edit Announcement";
					document.getElementById("title").value="(NEW) Metro line 5";
					document.getElementById("title").disabled = true;
					document.getElementById("body").innerHTML=
						"Lorem ipsum dolor sit amet, consectetur adipiscing elit." 
						+"Nam at sem sed eros malesuada dictum. Pellentesque dapibus eros at lectus pellentesque placerat. Nulla sed elit nunc"
						+", quis tincidunt est. Sed non massa mi, rutrum congue tellus. Praesent sagittis dolor eget magna faucibus quis vestibulum"
						+"mauris mollis. Mauris semper odio a erat tincidunt aliquet sed in nulla. Pellentesque mollis ante et metus mattis ac "
						+"cursus nulla iaculis. Maecenas lectus dolor, porta non imperdiet sit amet, mollis in turpis. Pellentesque habitant morbi"
						+"tristique senectus et netus et malesuada fames ac turpis egestas. Duis in tellus quis est viverra posuere quis sit amet "
						+"eros. Fusce nunc felis, vulputate a dictum vitae, feugiat nec ante. Duis ac lorem ut diam varius suscipit.";
						
				}					
			}
			function checkform()
			{
				var f = document.forms["my_form"].elements;
				var cansubmit=true;
				for (var i = 0; i < f.length; i++) {
					if (f[i].value.length==0) cansubmit=false;
				}
				if (cansubmit)
					document.getElementById('submit').disabled=false;
				else
					document.getElementById('submit').disabled=true;
			}

		</script>
	</head>
	<body onLoad="set()">
		<div id="container" width="80%">
			
			<form id="my_form" name="my_form" action="" class="wufoo">
			
				<br />
				<div class="section first" id="pageTitle">
				</div>
				
				<br />
				<table border="0" cellpadding="10" width="100%" summary="">
					<tr>
						<td><label class="desc">Title <span class="req">*</span></label></td>
						<td><input type="text" id="title" size="65" class="field text large" onKeyup="checkform()"/></td>
					</tr>
					<tr>
						<td valign="top"><label class="desc">Body <span class="req">*</span></label></td>
						<td>
							<textarea id="body" rows="10" cols="50" class="field textarea medium" onKeyup="checkform()"></textarea>
						</td>
					</tr>
					<tr>
						<td>
							
						</td>
						<td>
							<input class="btTxt" type="submit" id="submit" value="Post" disabled="true"/>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</body>
</html>